import i18n from '@/i18n'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
import { MetaFileBelong, MetaFileType } from '@prisma/client'

export class MetaFile {
  static ApiPropertyEnum = {
    MetaFileType: [i18n.t('app-meta.model.meta-file.1215079-0', { args: [MetaFileType.Image] })],
    MetaFileBelong: [
      i18n.t('app-meta.model.meta-file.1215079-1', { args: [MetaFileBelong.System] }),
      i18n.t('app-meta.model.meta-file.1215079-2', { args: [MetaFileBelong.Platform] }),
    ],
  }

  @ApiProperty({ description: 'ID', type: Number })
  id: number

  @ApiProperty({ description: i18n.t('app-meta.model.meta-file.1215079-3'), type: String })
  label: string

  @ApiProperty({ description: i18n.t('app-meta.model.meta-file.1215079-4'), type: String })
  url: string

  @ApiProperty({
    description: i18n.t('app-meta.model.meta-file.1215079-5'),
    enum: MetaFile.ApiPropertyEnum.MetaFileType,
  })
  type: MetaFileType

  @ApiProperty({
    description: i18n.t('app-meta.model.meta-file.1215079-6'),
    enum: MetaFile.ApiPropertyEnum.MetaFileBelong,
  })
  belong: MetaFileBelong

  @ApiProperty({ description: i18n.t('app-meta.model.meta-file.1215079-7'), type: Date })
  createTime: Date

  @ApiProperty({ description: i18n.t('app-meta.model.meta-file.1215079-8'), type: String })
  platform: string

  @ApiPropertyOptional({ description: i18n.t('app-meta.model.meta-file.1215079-9'), type: String })
  project?: string

  @ApiProperty({ description: i18n.t('app-meta.model.meta-file.1215079-10'), type: String })
  groupLabel: string

  @ApiPropertyOptional({ description: i18n.t('app-meta.model.meta-file.1215079-11'), type: Number })
  sortNo?: number
}
